<style lang="scss" scoped>
	@import "../var";
.user-center {
  width: 750upx;
  overflow-x: hidden;
  .icon_setUp {
    padding-left: 50upx;
    display: flex;
    justify-content: center;
    align-items: center;
    .setting {
      width: 44upx;
      height: 44upx;
    }
    .nav-text {
      color: #111;
      margin-left: 10upx;
    }
  }
}
.page-item {
  width: 750upx;
  overflow-x: hidden;
}
.userInfo {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  width: 750upx;
  height: 708upx;
  background: linear-gradient(to top, #1d293c, #25354b);

  .hbg{
	  position: absolute;
	  width: 300upx;
	  height: 300upx;
	  top: 0;
	  left: 0;
	  z-index: 3;
  }
  .userInfo-content{
	  position: absolute;
	  width: 620upx;
	  height: 568upx;
	  bottom: 0;
	  z-index: 4;
  }
  .userInfo-realContent {
    position: absolute;
    width: 620upx;
    height: 568upx;
    bottom: 0;
    z-index: 5;
	background-size: cover;
    border: none;
    border-radius: 20upx 20upx 0 0;
    font-size: 28upx;
    padding: 0;
    text-align: center;
    line-height: 40upx;
    font-weight: normal;
    font-style: normal;

    .user-text {
      text-align: left;
	  width: 560upx;
	  height: 180upx;
	  position: absolute;
	  top: 200upx;
	  left: 30upx;
	  z-index: 99;

      .userName {
        font-weight: 400;
        font-size: 40upx;
        color: #001432;
        font-style: normal;
        letter-spacing: 0;
        line-height: 60upx;
		padding-bottom: 12upx;
      }
      .edit-pen {
        width: 30upx;
        height: 30upx;
        display: inline-block;
		padding:0 20upx ;
		position: absolute;
		top: 20upx;
		z-index: 999;
      }
      .userBrief {
        width: 550upx;
        font-weight: 400;
        font-size: 24upx;
        color: #757474;
        font-style: normal;
        line-height: 36upx;
      }
    }

    .userImgBox {
      height: 118upx;
      margin-top: 70upx;
      margin-bottom: 30upx;
      .userImg {
        width: 118upx;
        height: 118upx;
        margin-left: 30upx;
        overflow: hidden;
        background-color: $img-color;
        border-radius: 30upx;
        image {
          width: 118upx;
          height: 118upx;
        }
      }
    }

    .user-vip {
      position: absolute;
      top: 20upx;
      right: 20upx;
      width: 188upx;
      text-align: right;
      border-radius: 25upx;
      height: 50upx;
      padding: 5upx 20upx;
      font-size: 20upx;
    }

    .user-id {
      position: absolute;
      top: 80upx;
      right: 20upx;
      width: 188upx;
      text-align: center;
      border-radius: 25upx;
      height: 50upx;
      background-color: rgba(0, 20, 50, 0.04);
      padding: 5upx 20upx;
      font-size: 20upx;
	  display: flex;
	  justify-content: center;
	  align-items: center;
	  letter-spacing: 2upx;
	  .vip{
		  width: 30upx;
		  height: 30upx;
		  margin-right: 10upx;
	  }
    }
  }

  .userInfo-realContent {
    z-index: 5;
    box-shadow: none;
    background-color: transparent;
  }

  .view-circle {
    overflow: hidden;
    border-width: 0;
    border-style: solid;
    position: absolute;
    z-index: 9;
    width: 750upx;
    height: 300upx;
    background: url(../static/sns/half-circle.png) no-repeat center;
    background-size: cover;
    bottom: 0;

    .view-circle-bg {
      width: 750upx;
      height: 100%;
    }
  }

  .userTabs {
    position: absolute;
    height: 120upx;
    width: 610upx;
    display: flex;
    z-index: 11;
    bottom: 100upx;
    left: 90upx;

    .tabItem {
      width: 284upx;
      height: 112upx;
      background-color: rgba(0, 20, 50, 0.04);
      border-radius: 8upx;
      display: flex;
      justify-content: center;
      align-items: center;

      .badges {
        position: absolute;
        bottom: 70upx;
        right: 215upx;
        background-color: #f73c52;
        height: 36upx;
        line-height: 36upx;
        border-radius: 18upx;
        padding: 0 14upx;
        margin-left: 20upx;
        color: #ffffff;
        font-size: 20upx;
        &.left {
          right: 510upx;
        }
      }

      .tabSvg {
        width: 40upx;
        height: 40upx;
        margin-right: 20upx;
      }

      .tabName {
        font-size: 32upx;
        color: #001432;
        font-style: normal;
        letter-spacing: 0px;
        line-height: 20px;
        margin-left: 10upx;
        &.left {
          margin-right: 10upx;
        }
      }

      &.left {
        margin-right: 10upx;
      }
    }
  }

  .buttonTabs {
    position: absolute;
    height: 50upx;
    width: 700upx;
    left: 15upx;
    display: flex;
    z-index: 11;
    bottom: 0upx;

    .buttonTab {
      width: 156upx;
      height: 58upx;
      border: none;
      border-radius: 76upx;
      font-size: 28upx;
      padding: 0px;
      font-style: normal;
      display: flex;
      align-items: center;
      justify-content: center;

      &.active {
        background-color: rgb(249, 249, 249);
        font-weight: bold;
      }

      &.left {
        margin-left: 0;
      }
    }
  }
}

// 动态相关瀑布流样式
.feeds-box {
  width: 735upx;
  margin-left: 13upx;
  padding-bottom: 20upx;
  padding-top: 30upx;

  .feed-one {
    width: 358upx;
    margin-bottom: 12upx;
    border-radius: 10upx;
    position: relative;
	background-color: #f9f9f9;

    .feed-img {
      width: 358upx;
      border-radius: 10upx 10upx 0 0;

      &.h-img {
        height: 488upx;
      }

      &.w-img {
        height: 358upx;
      }
    }

    .feed-title {
      width: 350upx;
      padding-top: 10upx;
      margin-left: 10upx;
      font-size: 28upx;
      line-height: 40upx;
      color: #001432;
      text-align: left;
      // font-family: ryfont !important;
    }

    .fvicon {
      position: absolute;
      right: 10upx;
      top: 10upx;
      z-index: 1;

      .play-icon {
        width: 40upx;
        height: 40upx;
      }
    }

    .feed-info {
      width: 350upx;
      height: 60upx;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      margin-top: 0;
      font-size: 20upx;
      color: #666;

      .left {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        width: 200upx;
        height: 60upx;
        .mbtn {
          padding: 0 20upx 10upx 10upx;
          display: flex;
          flex-direction: row;
          justify-content: center;
          align-items: center;
          justify-content: center;
          background-color: #f9f9f9;
        }
        .micon-love {
          width: 32upx;
          height: 28upx;
        }
        .micon-loved {
          width: 32upx;
          height: 28upx;
        }
        .micon-share {
          width: 28upx;
          height: 28upx;
        }

        .mtext {
          color: #999;
          font-size: 24upx;
          margin-left: 10upx;
        }
        .minfo {
          color: #999;
          font-size: 22upx;
          margin-left: 12upx;
          padding-bottom: 6upx;
        }
      }
      .right {
        .micon-more {
          width: 36upx;
          height: 32upx;
          padding-top: 16upx;
          padding-right: 6upx;
        }
      }
    }
  }
}
</style>

<template>
	<view class="user-center">
		<!-- 顶部导航 -->
		<mnav-bar :bgColor="bgColor" :fontColor="fontColor" :shadow="shadow" backState="2000" fontColor="#FFF" :titleCenter="false"
		 :type="navType">
			<view class="icon_setUp" slot="left">
				<!-- <u-icon name="setting-fill" :color="fontColor" size="44" @tap="goToPage('/mine/set')" /> -->
				<!-- <image class="setting" v-if="fontColor == '#FFFFFF'" src="../static/setup.png" mode="aspectFit" @tap="goToPage('/mine/set')" /> -->
				<image class="setting" v-if="fontColor !== '#FFFFFF'" src="../static/setup_b.png" mode="aspectFit" @tap="goToPage('/mine/set')" />
				<text v-if="shadow" class="nav-text">柔性星球 · 个人中心</text>
			</view>
		</mnav-bar>

		<!-- 页面区域 允许滚动 -->
		<view class="page-item">
			<!-- 用户信息卡片 -->
			<view class="userInfo">
				<image class="hbg" src="../static/hbg.png" mode="aspectFit"/>
				<image class="userInfo-content" src="../static/ubg.png" mode="aspectFit"/>
				<view class="userInfo-realContent">
					<view class="userImgBox">
						<view class="userImg">
							<image mode="aspectFill" v-if="user.avatar.url||user.avatar" :src="user.avatar.url||user.avatar" @tap="handleAvatarTap(user.avatar.url||user.avatar)" />
							<!-- <open-data v-else type="userAvatarUrl"></open-data> -->
						</view>
					</view>
					<!-- <view class="user-vip" v-if="!!user.vip && !!user.vip.name">尊享用户</view> -->
					<view class="user-id">
						<image class="vip" src="../static/vip.png" mode="aspectFit"/>
						<view>{{user.rouyu_uid.substring(user.rouyu_uid.length-6)}}</view>
					</view>
					<view class="user-text"  @tap="goToPage('/mine/setting')">
						<text v-if=" user.name != '' " class="userName">{{user.name}}</text>
						<!-- <open-data v-else type="userNickName" class="userName"></open-data> -->
						<image class="edit-pen" src="../static/edit_me.png" mode="aspectFit"></image>
						<view class="userBrief">
							{{user.bio ? user.bio : '这个人有点懒，什么都没留下'}}
						</view>
					</view>
					
				</view>

				<!-- 下面的半圆导航 -->
				<view class="view-circle" />


				<view class="userTabs">
					<view class="tabItem left" @tap="goToPage('/mine/set')">
						<img class="tabSvg" src="../static/setup_b.png" mode="aspectFit" />
						<text class="tabName">个人设置</text>
						<!-- <text class="badges left" v-if=" vuex_user.notificationNum > 1000 ">{{ vuex_user.notificationNum }}</text> -->
					</view>
					<view class="tabItem" @tap="goToPage('/pages/myNews')">
						<img class="tabSvg" src="../static/bell.png" mode="aspectFit" />
						<text class="tabName">我的消息</text>
						<text class="badges right" v-if=" vuex_user.notificationNum > 0 ">{{ vuex_user.notificationNum }}</text>
					</view>
				</view>
				<view class="buttonTabs">
					<view class="buttonTab left active">
						<text>动态 {{sendFeedsNum}}</text>
					</view>
				</view>
			</view>
			
			
			
			<view class="feeds-box">
				<u-waterfall v-model="feedList" ref="uWaterfall">
					<template v-slot:left="{leftList}">
						<view class="feed-one" v-for="(item, index) in leftList" :key="index">
							<view @tap=" gotoLink('/feed/feed?id=' + item.id , item.visible) ">
								<!-- 动态无封面模式 -->
								<image class="feed-img" v-if="item.images.length > 0 " :class="item.images[0].dimension.height/item.images[0].dimension.width > 1 ? 'h-img' : 'w-img' "
								 :src="item.images[0].url" mode="aspectFill" :lazy-load="true" />
								<!-- 动态有封面模式 -->
								<image class="feed-img" v-if="item.images.length <= 0 && !!item.video" :class="item.video.cover.dimension.height/item.video.cover.dimension.width > 1 ? 'h-img' : 'w-img' "
								 :src="item.video.cover.url" mode="aspectFill" :lazy-load="true" />

								<view v-if=" item.images.length <= 0 && !!item.video" class="fvicon">
									<image src="../static/play.png" class="play-icon" />
								</view>
								<!-- 标题 -->
								<view class="u-line-2 feed-title" v-if="item.feed_content">{{ item.feed_content }}</view>
								<view class="feed-info">

									<view class="left" v-if="item.visible > 0">
										<!-- 点赞相关统计 -->
										<view class="mbtn" @tap.stop="clickLove(item)">
											<image v-if="item.has_liked" src="../static/lover.png" class="micon-loved" />
											<image v-else src="../static/love.png" class="micon-love" />
											<text class="mtext" v-if=" item.like_count>0 ">{{ item.like_count }}</text>
										</view>
										<!-- 评论次数 -->
										<view class="mbtn">
											<image src="../static/msg.png" class="micon-share" />
											<text class="mtext" v-if=" item.feed_comment_count>0 ">{{ item.feed_comment_count }}</text>
										</view>
									</view>

									<view class="left" v-else>
										<text class="minfo">审核中</text>
									</view>
									<!-- 分享 -->
									<view class="right" @tap.stop="openSheet(item.id)">
										<image src="../static/more.png" class="micon-more" />
									</view>
								</view>
							</view>
						</view>
					</template>
					<template v-slot:right="{rightList}">
						<view class="feed-one" v-for="(item, index) in rightList" :key="index">
							<view @tap=" gotoLink('/feed/feed?id=' + item.id, item.visible) " data-visible="item.visible">
								<!-- 动态无封面模式 -->
								<image class="feed-img" v-if="item.images.length > 0 " :class="item.images[0].dimension.height/item.images[0].dimension.width > 1 ? 'h-img' : 'w-img' "
								 :src="item.images[0].url" mode="aspectFill" :lazy-load="true" />
								<!-- 动态有封面模式 -->
								<image class="feed-img" v-if="item.images.length <= 0 && !!item.video" :class="item.video.cover.dimension.height/item.video.cover.dimension.width > 1 ? 'h-img' : 'w-img' "
								 :src="item.video.cover.url" mode="aspectFill" :lazy-load="true" />

								<view v-if=" item.images.length <= 0 && !!item.video" class="fvicon">
									<image src="../static/play.png" class="play-icon" />
								</view>
								<view class="u-line-2 feed-title" v-if="item.feed_content">{{ item.feed_content }}</view>
								<view class="feed-info">
									<view class="left" v-if="item.visible > 0">
										<!-- 点赞相关统计 -->
										<view class="mbtn" @tap.stop="clickLove(item)">
											<image v-if="item.has_liked" src="../static/lover.png" class="micon-loved" />
											<image v-else src="../static/love.png" class="micon-love" />
											<text class="mtext" v-if=" item.like_count>0 ">{{ item.like_count }}</text>
										</view>
										<!-- 评论次数 -->
										<view class="mbtn">
											<image src="../static/msg.png" class="micon-share" />
											<text class="mtext" v-if=" item.feed_comment_count>0 ">{{ item.feed_comment_count }}</text>
										</view>
									</view>
									<view class="left" v-else>
										<text class="minfo">审核中</text>
									</view>
									<!-- 分享 -->
									<view class="right" @tap.stop="openSheet(item.id)">
										<image src="../static/more.png" class="micon-more" />
									</view>
								</view>
							</view>
						</view>
					</template>
				</u-waterfall>
			</view>
		</view>
		<!-- 登陆组件 -->
		<login ref="login"></login>
		<!-- 分享按钮及其相关逻辑 -->
		<goto-share />
	</view>
</template>

<script>
	import {
		$storage
	} from "@/utils";
	// 引入分享组件
	import gotoShare from "../components/basic/gotoShare.vue";
	export default {
		data() {
			return {
				// 当前用户信息
				user: {
					id: 0,
					name: '',
					bio: '未登录',
					rouyu_uid: '00000000'
				},
				// 当前用户发布多少条动态
				sendFeedsNum: "",
				// 导航条阴影
				shadow: false,
				// 导航栏背景颜色
				bgColor: "#111111",
				// 导航栏字体颜色
				fontColor: "#FFFFFF",
				// 导航条状态
				navType: "transparent",
				// 当前用户 动态列表
				feedList: [],
				saveFeedList: [],
				// 当前用户请求动态状态
				canRequestFeeds: "yes",
				// 滚动条位置
				scrollTop: 0,
				oldScrollTop: 0,
				notifications: {},
				badges: {
					notificationNum: 0,
				},
				// 点赞状态器
				canLoveTag: true,
				islogin: false,
			};
		},
		components: {
			gotoShare
		},
		// 下拉置底刷新
		onReachBottom() {
			this.onreachBottom();
		},
		// 顶部下拉刷新
		async onPullDownRefresh() {
			this.canRequestFeeds = "yes";
			this.getUserInfo();
			this.feedList = [];
			this.$refs.uWaterfall.clear();
			this.onreachBottom();
			const user = $storage.get("user");
			if (!user) return;
			this.user = await this.$u.api.getCurrentUser();
			$storage.set("user", this.user);
			this.$u.vuex("vuex_user", this.user);
			const notifications = await this.$u.api.getNewsList();
			// 所有消息数量
			let notificationNum = notifications.badges.like + notifications.badges.comment;
			if (notificationNum > 0) {
				// console.log("setB" + notificationNum)
				uni.setTabBarBadge({
					index: 2,
					text: notificationNum.toString()
				})
			} else {
				// console.log("setBBB" + notificationNum)
				uni.removeTabBarBadge({
					index: 2
				})
			}
			user.notificationNum = notificationNum;
			user.notificationNumLike = notifications.badges.like;
			user.notificationNumComment = notifications.badges.comment;
			// 做状态管理，进行信息通信
			this.$u.vuex("vuex_user", user);
			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		async onShow() {
			
			const user = $storage.get("user");
			if (!user) return;
			// this.getBasicData();
			const notifications = await this.$u.api.getNewsList();
			// 所有消息数量
			let notificationNum = notifications.badges.like + notifications.badges.comment;
			if (notificationNum > 0) {
				// console.log("setB" + notificationNum)
				uni.setTabBarBadge({
					index: 2,
					text: notificationNum.toString()
				})
			} else {
				uni.removeTabBarBadge({
					index: 2
				})
			}
			user.notificationNum = notificationNum;
			user.notificationNumLike = notifications.badges.like;
			user.notificationNumComment = notifications.badges.comment;
			// 做状态管理，进行信息通信
			this.$u.vuex("vuex_user", user);
		},
		// 页面滚动事件
		onPageScroll(scrollTop) {
			let stop = scrollTop.scrollTop
			this.oldScrollTop = stop;
			if (stop >= 120) {
				this.navType = "fixed";
				this.shadow = true;
				this.bgColor = "#FFFFFF";
				this.fontColor = "#000000";
			} else {
				this.navType = "transparent";
				this.shadow = false;
				this.bgColor = "#111";
				this.fontColor = "#FFFFFF";
			}
		},
		// 显示的时候 开启 bus 事件
		async onLoad() {
			
			// console.log(this.vuex_user.notificationNum)
			await this.$u.api.checkLogin();
			this.getBasicData();
			// 注册登陆之后的事件
			uni.$on("after:login", async () => {
				// console.log("登陆状态发生改变，触发个人中心页面数据变化")
				this.getBasicData();
			});
			// 事件 bus 删除动态事件触发
			uni.$on("removeOneFeed", fid => {
				this.feedList = this.saveFeedList;
				this.feedList.map((one, index) => {
					if (one.id == fid) {
						console.log("触发了一次删除元素操作")
						this.$refs.uWaterfall.remove(fid);
						this.sendFeedsNum--;
						this.saveFeedList.splice(index, 1);
						this.feedList = this.saveFeedList;
					}
				});
			});
			// 详情页点赞的时候，触发 个人 动态点赞数量的变化
			uni.$on("userLoveChange", (item) => {
				// console.log(item);
				this.feedList.map((one) => {
					if (one.id == item.data.id) {
						this.$refs.uWaterfall.modify(
							one.id,
							"like_count",
							item.data.like_count
						);
						this.$refs.uWaterfall.modify(
							one.id,
							"has_liked",
							item.data.has_liked
						);
					}
				});
			});
			// 详情页评论的时候，触发 个人 动态评论数量的变化
			uni.$on("userCommentChange", (item) => {
				// console.log(item);
				this.feedList.map((one) => {
					if (one.id == item.data.id) {
						this.$refs.uWaterfall.modify(
							one.id,
							"feed_comment_count",
							item.data.feed_comment_count
						);
					}
				});
			});
			// 修改个人信息时触发
			uni.$on("userInfoChange", () => {
				this.getUserInfo()
			});
			// 发布了一条新动态，触发个人中心的相关变化
			uni.$on("userFeddsNumChange", (data) => {
				this.canRequestFeeds = "yes";
				// console.log("发布了一条新动态，触发个人中心的相关变化")
				this.feedList = [];
				this.$refs.uWaterfall.clear();
				this.onreachBottom();
				this.sendFeedsNum++;
				this.scrollTop = this.oldScrollTop;
				this.$nextTick(() => {
					this.scrollTop = 0;
				});
			});
		},
		methods: {
			// 获取初始内容信息
			async getBasicData() {
				// 获取 动态列表
				const user = $storage.get("user");
				if (!!user && !!user.id) {
					await this.getUserInfo();
					this.islogin = true;
					this.$refs.uWaterfall.clear();
					// 异步获取 当前用户一共发送了多少条动态
					let feedListInfo = await this.$u.api.getNewStorys({
						user: user.id,
						page: 1,
						limit: 1
					});
					this.sendFeedsNum = feedListInfo.meta.total;
					this.feedList = await this.$u.api.getNewStorys({
						category: 0,
						user: user.id,
						limit: 12,
						offset: 0,
					});
					this.saveFeedList = this.feedList;
				}
			},
			/** 点击头像预览头像大图 */
			handleAvatarTap(url) {
				// console.log("read bg picd")
				uni.previewImage({
					urls: [url]
				});
			},
			// 跳转到 动态 详情页面
			gotoLink(url, visible) {
				if (visible > 0) {
					uni.navigateTo({
						url,
					});
				} else {
					uni.showToast({
						title: "内容审核中",
						icon: "success",
						duration: 1000,
					});
				}

			},
			// 打开删除弹窗
			async openSheet(fid) {
				const user = $storage.get("user");
				if (!user) return;
				uni.showActionSheet({
					itemList: ["删除"],
					success: async (res) => {

						// console.log(fid)
						// 删除当前评论
						await this.$u.api.delectOneFeed(fid);
						// 首页 移除当前动态，总动态条数 -1
						uni.$emit("removeOneFeed", fid);
						// 触发 删除事件
						uni.showToast({
							title: "当前动态已删除",
							duration: 1000
						})
					},
					fail: (res) => {
						// console.log(res.errMsg);
					},
				});
			},
			// 点赞按钮
			async clickLove(item) {
				if (!this.canLoveTag) return;
				this.canLoveTag = false;
				let loginStatus = await this.$u.api.checkLogin();
				if (!loginStatus) {
					this.canLoveTag = true;
					return;
				}
				// 动态点赞
				if (item.has_liked) {
					--item.like_count;
					item.has_liked = false;
					await this.$u.api.unlikeThisFeed({
						id: item.id,
					});
					uni.showToast({
						title: "取消点赞",
						icon: "success",
						duration: 1000,
					});
					this.canLoveTag = true;
				} else {
					++item.like_count;
					item.has_liked = true;
					await this.$u.api.likeThisFeed({
						id: item.id,
					});
					uni.showToast({
						title: "点赞成功",
						icon: "success",
						duration: 1000,
					});
					this.canLoveTag = true;
				}
				this.$refs.uWaterfall.modify(item.id, "like_count", item.like_count);
				this.$refs.uWaterfall.modify(item.id, "has_liked", item.has_liked);
			},
			// scroll-view到底部加载更多
			onreachBottom() {
				const user = $storage.get("user");
				if (!user) return;
				if (this.canRequestFeeds == "yes") {
					uni.showToast({
						title: "请求中...",
						icon: "loading",
						duration: 10000,
					});
					this.canRequestFeeds = "no";
					this.$u.api
						.getNewStorys({
							category: 0,
							user: this.user.id,
							limit: 12,
							offset: this.feedList.length,
						})
						.then((feeds) => {
							// console.log(feeds)
							uni.hideToast();
							if (feeds.length > 0) {
								this.feedList = [...this.feedList, ...feeds];
								this.saveFeedList = this.feedList;
								let timer = setTimeout(() => {
									clearTimeout(timer);
									this.canRequestFeeds = "yes";
								}, 500);
							} else {
								this.canRequestFeeds = "end";
								uni.showToast({
									title: "到底啦！",
									icon: "success",
									duration: 1000,
								});
							}
						});
				}
				if (this.canRequestFeeds == "end") {
					uni.hideToast();
					uni.showToast({
						title: "到底啦！",
						icon: "success",
						duration: 1000,
					});
				}
			},
			// 跳转到页面
			goToPage(url) {
				// console.log(url)
				if (!!this.user && this.user.id > 0) {
					wx.navigateTo({
						url,
					});
				} else {
					uni.$emit("login");
				}
			},
			// 跳转到商城页面
			goStoreWebView(url){
				uni.navigateTo({
					url: '/mine/storeWebView?url=' + encodeURI(url),
				});
			},
			/**
			 * 获取用户信息
			 */
			getUserInfo() {
				const user = $storage.get("user");
				if (!user) return;
				this.user = user;
			},
		},
	};
</script>
